#include <iostream>
using namespace std;

class Base1
{
	private :
		int m_b1;
	public :
		Base1(int b1 = 1) :
			m_b1(b1)
		{
			cout << "<Base1 init()>" << endl;
		}

		~Base1()
		{
			cout << "<~Base1()>" << endl;
		}
};

class Base2
{
	private :
		int m_b2;
	public :
		Base2(int b2 = 2) :
			m_b2(b2)
		{
			cout << "<Base2 init()>" << endl;
		}

		~Base2()
		{
			cout << "<~Base2()>" << endl;
		}
};

class Level1 : public Base2, virtual public Base1
{
	private :
		int m_l1;
	public :
		Level1(int l1 = 12) :
			Base1(3), Base2(4), m_l1(l1)
		{
			cout << "<Level1 init()>" << endl;
		}

		~Level1()
		{
			cout << "<~Level1()>" << endl;
		}
};

class Level2 : public Base2, virtual public Base1
{
	private :
		int m_l2;
	public :
		Level2(int l2 = 12) :
			Base1(5), Base2(6), m_l2(l2)
		{
			cout << "<Level2 init()>" << endl;
		}

		~Level2()
		{
			cout << "<~Level2>" << endl;
		}
};

class Toplevel : public Level1, virtual public Level2
{
	private :
		int m_tl;
	public :
		Toplevel(int tl = 1234) :
			Level1(13), Level2(14), m_tl(tl)
		{
			cout << "<Toplevel init()>" << endl;
		}

		~Toplevel()
		{
			cout << "<~Toplevel()>" << endl;
		}
};

int main()
{
	Toplevel tp1;
}
